<template>
  <br />
  <p class="intro">{{ intro.b_intro }}</p>
</template>
<script setup>
import { ref } from "vue";
import { post } from "@/common";

const b_id = ref(null);

const intro = ref({});
const getIntro = () => {
  b_id.value = window.location.search.split("=")[1];
  console.log("通过书籍编号 b_id = " + b_id.value + "获取书籍简介!");

  if (b_id.value == "") {
    console.log("警告：系统错误！检索关键字为空！");
    return;
  }
  post("/book/detail/intro/" + b_id.value).then((res) => {
    console.log("获得书籍简介成功!");
    intro.value = res.data;
  });
};

getIntro();
</script>

<style>
.intro {
  text-indent: 2em;
  font-size: small;
  width: 70%;
}
</style>

